﻿namespace My.Hydrator.Tests
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using My.Hydrator.Conventions;

    [TestClass]
    public class InheritanceTests
    {
        [TestMethod]
        public void HydratorShouldBeAbleToHydrateInheritedProperties()
        {
            var hydrator = new Hydrator();
            var person = hydrator.Hydrate<Person>();

            Assert.IsTrue(person.Id > 0);
        }

        [TestMethod]
        public void HydratorShouldBeAbleToHydrateInheritedPropertiesUsingOverloadedConventions()
        {
            var hydrator = new Hydrator();
            hydrator.Configure(x => x.For<int>().Use(new IntTypeConvention(1, 1)));

            var person = hydrator.Hydrate<Person>();

            Assert.AreEqual(1, person.Id);
        }
    }
}
